﻿Public Class frmBuscarFactura 

    Private Sub frmBuscarFactura_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        VfacturahistorialTableAdapter.FillByTOP500(DbFireAndIceDataSet.vfacturahistorial)
    End Sub

    Private Sub btVer_Click(sender As System.Object, e As System.EventArgs) Handles btVer.Click
        Dim idfact As Integer = GridView2.GetRowCellValue(GridView2.FocusedRowHandle, "idfact")
        If GridView2.GetRowCellValue(GridView2.FocusedRowHandle, "esnula") Then
            My.Forms.frmHistorialFacturas.txtAnulada.Visible = True
        Else
            My.Forms.frmHistorialFacturas.txtAnulada.Visible = False
        End If

        My.Forms.frmHistorialFacturas.TextEdit1.EditValue = idfact
        Close()
    End Sub

    Private Sub btTop500_Click(sender As System.Object, e As System.EventArgs) Handles btTop500.Click
        VfacturahistorialTableAdapter.FillByTOP500(DbFireAndIceDataSet.vfacturahistorial)
    End Sub

    Private Sub btTodo_Click(sender As System.Object, e As System.EventArgs) Handles btTodo.Click
        VfacturahistorialTableAdapter.Fill(DbFireAndIceDataSet.vfacturahistorial)
    End Sub
End Class